package cn.com.cetccst.compliancecheck.ui;

import cn.com.cetccst.compliancecheck.BR;
import cn.com.cetccst.compliancecheck.R;
import cn.com.cetccst.compliancecheck.databinding.FragmentComplianceBinding;
import cn.com.cetccst.compliancecheck.ui.viewmodel.ComplianceViewModel;
import cn.com.cetccst.datacenter.policy.entity.ComplianceEntity;
import cn.com.cetccst.uicomponents.binding.app.DataBindingConfig;
import cn.com.cetccst.uicomponents.binding.app.DataBindingFragment;

public class ComplianceFragment extends DataBindingFragment<FragmentComplianceBinding> {

    private ComplianceViewModel viewModel;
    private ComplianceAdapter adapter;

    @Override
    protected void initViewModel() {
        viewModel = getFragmentScopeViewModel(ComplianceViewModel.class);
        adapter = new ComplianceAdapter(getContext(), item -> {
            //TODO 点击操作
        });
    }

    @Override
    protected DataBindingConfig getDataBindingConfig() {
        return new DataBindingConfig(R.layout.fragment_compliance, BR.viewModel, viewModel)
                .addBindingParam(BR.adapter, adapter);
    }

    public interface OnFragmentInteractionListener {
        void onListFragmentInteraction(ComplianceEntity item);
    }

}
